package com.hospital.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hospital.domain.pojo.Doctor;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface DoctorMapper extends BaseMapper<Doctor> {

    @Select("select * from doctor where depId = #{depId}")
    List<Doctor> queryDoctorByDepId(Integer depId);

    @Select("SELECT d.*, dep.depName FROM doctor d LEFT JOIN department dep ON d.depId = dep.depId")
    List<Map<String, Object>> queryAllDoctorsWithDepartment();
}
